let mysql = require('mysql');
var connection;
class Sql{
    // constructor(){} 构造函数
    get(sql,variable,callback){
        connection   = mysql.createConnection({
            host     :'59.110.105.164',
            user     : 'root',
            password : 'root',
            port: '3306',
            database:'lening_school'
        });
        connection.connect();
        connection.query(sql,variable, (err,result) => {
            callback(err, result);
    });
        connection.end();
    }
}
module.exports = Sql;